<#macro head>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
    <meta name="viewport" content="width=device-width, initial-scale=1"/>
    <title>${title!}</title>
    <link href="https://cdn.bootcss.com/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
    <link href="/css/navbar.css" rel="stylesheet"/>
      <script>
var _hmt = _hmt || [];
(function() {
  var hm = document.createElement("script");
  hm.src = "https://hm.baidu.com/hm.js?86ebba8ed85f16d346aadff2cd5b6d84";
  var s = document.getElementsByTagName("script")[0];
  s.parentNode.insertBefore(hm, s);
})();
</script>
</head>
<body>
<div class="container">
      <!-- Static navbar -->
      <nav class="navbar navbar-default">
        <div class="container-fluid">
          <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
              <span class="sr-only">Toggle navigation</span>
              <span class="icon-bar"></span>
              <span class="icon-bar"></span>
              <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="/">CP系统</a>
          </div>
          <div id="navbar" class="navbar-collapse collapse">
            <ul class="nav navbar-nav">
              <li <#if request.requestUri=="/">class="active"</#if>><a href="/">首页</a></li>
              <li <#if request.requestUri=="/bjpk10/">class="active"</#if> ><a href="/bjpk10/">北京赛车</a></li>


              <li class="dropdown"    <#if !Session["user"]??>style=" display: none;"</#if> >
                <a href="#" class="dropdown-toggle " data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">个人信息 <span class="caret"></span></a>
                <ul class="dropdown-menu">

<#if Session["user"]??><li class="dropdown-header">登录ID:${Session["user"].uid}</li></#if>
              <li><a href="/user/userInfo"> 查看个人信息 </a></li>
              <li><a href="/user/changePasswd"> 修改密码 </a></li>
              <li> <a href="/user/updateBank"> 设置银行卡 </a></li>


                  <li role="separator" class="divider"></li>
                  <li><a href="/money/recharge">充值</a></li>
                  <li><a href="/money/searchRecharge">充值记录</a></li>
                  <li role="separator" class="divider"></li>
                  <li ><a href="/money/withdraw">提现</a></li>
                  <li><a href="/money/searchWithdraw">充值记录</a></li>
                  <li role="separator" class="divider"></li>
                  <li><a href="/money/searchMoneyLog">全部资金流水</a></li>
              <#--
                  <li role="separator" class="divider"></li>
                  <li><a href="#">Another action</a></li>
                  <li><a href="#">Something else here</a></li>
                  <li role="separator" class="divider"></li>

                  <li><a href="#">Separated link</a></li>
                  <li><a href="#">One more separated link</a></li>
                 -->
                </ul>
              </li>
            </ul>
            
            <ul class="nav navbar-nav navbar-right">

              <#if Session["user"]??>
              <li><a href="/user/userInfo">余额:${Session["user"].money!'0.00'}</a></li>
              <li ><a href="/api/user/logout"> 安全退出</a></li>

              <#else>
              <li><a href="/user/login"> 用户登陆 </a></li>
              <li><a href="/user/register">用户注册 </a></li>
              </#if>
              <li> <a href="/admin/index"> 管理后台 </a></li>
            </ul>
          </div><!--/.nav-collapse -->
        </div><!--/.container-fluid -->
      </nav>
</div> 
<#nested>



</body>
</html>
</#macro>

<#macro js>
<script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="/js/jquery.min.js"><\/script>')</script>
<script src="https://cdn.bootcss.com/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script type="text/javascript"> 
<#nested>
</script>
</#macro> 
   
<#macro select id datas value="" key="key" text="value" >
     <select id="${id}" name="${id}" class="form-control">
          <#list datas as data>
              <#if key!="">
                  <#if value == data[key]?string>
                   <option value="${data[key]}" selected>${data[text]}</option>
                  <#else>
                   <option value="${data[key]}">${data[text]}</option>
                 </#if>
              <#else>
                  <#if value == data>
                     <option value="${data}" selected>${data}</option>
                 <#else>
                 <option value="${data}">${data}</option>
              </#if>
             </#if>
          </#list>
     </select>
</#macro>


<#macro page link pages>
<nav aria-label="Page navigation">
  <ul class="pagination">
  <li><a href="${link}">首页</a></li>

 <#if !pages.isFirstPage>
    <li>
      <a href="${link}?page=${pages.prePage!}" aria-label="Previous">
        <span aria-hidden="true">上一页</span>
      </a>
    </li>
</#if>
<li><a>当前第${pages.pageNum!}页</a></li>
<li><a>总行数:${pages.total!},总${pages.pages!}页</a></li>

<#if !pages.isLastPage>
    <li>
      <a href="${link}?page=${pages.nextPage!}" aria-label="Next">
        <span aria-hidden="true">下一页</span>
      </a>
    </li>
</#if>
  </ul>
</nav>
</#macro>